﻿using System.Security.Cryptography;
using System.Text;

namespace GrainManage.Encrypt
{
    public class MD5Encrypt
    {
        public static string Encrypt(string text)
        {
            using (MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider())
            {
                byte[] inputData = Encoding.UTF8.GetBytes(text);
                byte[] outputData = md5.ComputeHash(inputData);
                string result = FormatConvertor.ToHexString(outputData);
                return result;
            }
        }
    }
}
